/*
 * @Author: Jiraiya
 * @Date: 2020-04-27 16:49:33
 * @LastEditors: Jiraiya
 * @LastEditTime: 2020-04-30 17:16:44
 * @Description: 
 */
import fetch from 'node-fetch'

export async function getStaticPaths(){
    const res = await fetch('http://localhost:3000/api');
    const posts = await res.json();
    return {
        paths: ["/home/a", "/home/b", "/home/c"],
        fallback: false
    }
}

export async function getStaticProps({params}){
    const res = await fetch('http://localhost:3000/api');
    const posts = await res.json();
    return {
        props: {
            id: params.id
        }
    }
}

function HomePage(props) {
    return <div>Welcome to Next.js!</div>
}
  
export default HomePage;